package Tools 
{
    public class RandTool
	{
        public static function randArrayElements(list:Array, num:int):Array
		{
            var index:int;
            var randedList:Array = new Array();
            var randList:Array = new Array();
            if (list.length < num)
			{
                return list;
            }
            while (randList.length < num)
			{
				index = randInt(0, list.length - 1);
                if (randedList[index] != 1)
				{
					randList.push(list[index]);
					randedList[index] = 1;
                }
            }
            return randList;
        }
		
		public static function randInt(min:int, max:int):int
		{
			var random:Number = Math.random() - 0.001;
			var rand:int = min + int(random * (max - min + 1));
			return rand;
		}
		public static function randNumber(min:Number, max:Number):Number
		{
			return min + Math.random() * (max - min);
		}
    }
}